<?php
/**
* @version		1.0 : view.html.php marum56
* @package		Joomla
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );

jimport( 'joomla.application.component.view');


/**
 * HTML View class for the Producent component
 *
 * @static
 * @package	Joomla
 * @subpackage	Producenci
 * @since 1.0
 */
class ProducenciViewProducent extends JView
{
	function display($tpl = null)
	{       
		$cid = JRequest::getVar( 'cid', array(0), '', 'array' );
		$edit = JRequest::getVar('edit',true);
		
		JArrayHelper::toInteger($cid, array(0));

		$db =& JFactory::getDBO();
		
		if ($edit)
			$producent =& msProducent::getInstance( $cid[0] );
		else
			$producent =& msProducent::getInstance();

		// Binduj obiekt producenta, gdy wracamy po nieudanej
		// probie zapisu danych.
		// W normalnej sytuacji, gdy wyswietlamy szczegoly to
		// obiekt wypelniamy polami z tabeli.
		$post = JRequest::get('post');
		if ($post) {
			$producent->bind($post);
		}
	
		$this->assignRef('producent', $producent);

		parent::display($tpl='pdf');
	}
}
